# Maintainer: David Runge <dvzrv@archlinux.org>

_name=infamousPlugins
pkgname=infamousplugins
pkgver=0.3.2
pkgrel=1
pkgdesc="A collection of open-source LV2 plugins"
arch=(loong64 x86_64)
url="https://ssj71.github.io/infamousPlugins/"
license=(GPL2)
groups=(
  lv2-plugins
  pro-audio
)
depends=(
  cairo
  gcc-libs
  glibc
  lv2-host
)
makedepends=(
  cmake
  fftw
  lv2
  ntk
  zita-resampler
)
source=(
  https://github.com/ssj71/$_name/archive/v$pkgver/$_name-v$pkgver.tar.gz
)
sha512sums=('ecedbdb208d8ed8dfa8de02075851bd7183b814ea22554d07f232ff616dc26e5ff51d5088d0ec72e73c01cb613f375ea1fa4fdd2c83109bf9288a528214b0fc2')
b2sums=('d7900492c85e2fbc6be464426797c8833fcf7fa58b64c191b6bc3737b00b39ff653a381d30523fd915f810094da704b50f66bb0df1b30c5ce49ee67141ca69c1')

build() {
  local cmake_options=(
    -B build
    -D CMAKE_BUILD_TYPE=None
    -D CMAKE_INSTALL_PREFIX=/usr
    -S $_name-$pkgver
    -W no-dev
  )

  cmake "${cmake_options[@]}"
  cmake --build build --verbose
}

check() {
  ctest --test-dir build --output-on-failure
}

package() {
  depends+=(
    fftw libfftw3f.so
    ntk libntk.so
    zita-resampler libzita-resampler.so
  )

  DESTDIR="$pkgdir" cmake --install build
  install -vDm 644 $_name-$pkgver/{CHANGELOG,README} -t "$pkgdir/usr/share/doc/$pkgname/"
}
